﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using theeg.DependencyAnalysis.CommonAddin.Models;
using UnitTests;

namespace IntegrationTests
{
    [TestClass]
    public class RuleCompilerTest
    {
        [TestMethod]
        public void EmptyRuleCanCompile()
        {
            var ruleDescriptor = new RuleDescriptor();
            var compiledRule = RuleCompiler.Compile(ruleDescriptor);
            Assert1.DoesNotThrow<Exception>(compiledRule.Execute);
        }

        [TestMethod]
        public void ThrowExceptionInRule()
        {
            var ruleDescriptor = new RuleDescriptor
            {
                Source = "throw new NotImplementedException();"
            };
            var compiledRule = RuleCompiler.Compile(ruleDescriptor);
            Assert1.Throws<NotImplementedException>(compiledRule.Execute);
        }

        [Ignore]
        [TestMethod]
        public void UseVerifierInRule()
        {
        }

        [Ignore]
        [TestMethod]
        public void UseAssertOkInRule()
        {
        }

        [Ignore]
        [TestMethod]
        public void UseAssertNokInRule()
        {
        }

        [Ignore]
        [TestMethod]
        public void UseLinqInRule()
        {
        }

        [Ignore]
        [TestMethod]
        public void AccessFiltersForVerifyThat()
        {
        }
    }
}
